package com.projectbox.dao;

import java.util.List;

import com.projectbox.model.Resource;
import com.projectbox.model.Folder;

public interface ResourceDao {

	Resource getResourceById(Long id);
	
	void insert(Resource resource);
	
	void delete(Long id);
	
	void renameResource(Long id, String name, String newType);
	
	Resource checkResourceName(Long fid, String newName);
	
	void updateLastModify(Long id, long modifyTime);
	
	List<Resource> getAllProjectResources(Long pid);
	
	List<Resource> getProjectResources(Long pid);
	
	List<Resource> getProjectResourcesByUserId(Long uid, Long pid);
	
	List<Resource> getResourcesByUserId(Long uid);
	
	void insertFolder(Folder folder);
	
	void deleteFolder(Long fid);
	
	void renameFolder(Long fid, String name);
	
	Folder checkFolderName(Long preId, String newName);
	
	void deleteResourcesInFolder(Long fid);
	
	Folder getFolderById(Long id);
	
	List<Folder> getSubfolders(Long fid);
	
	List<Resource> getResourcesByFolder(Long fid);
	
	List<Folder> getSubfoldersByPid(Long pid);	
	
	List<Resource> getLatestResources(Long uid);
}
